<?php

class FacultyProject{

	public $idFaculty;
	public $idProject;
	public $projectName;

	public static function getFacultyProjectByFaculty($idFaculty){
		$query = "SELECT IdFaculty, IdProject as Id, Title FROM facultyproject, project WHERE project.Id = facultyproject.idProject AND IdFaculty={$idFaculty}";
		return getQueryArray($query);
	}
	
	public static function insertFacultyProject($idFaculty, $idProject){
		$query = "INSERT INTO facultyproject(IdFaculty, IdProject) values ({$idFaculty}, {$idProject})";
		getQueryUpdate($query);
	}

	public static function deleteFacultyProject($idFaculty){
		$query = "DELETE FROM facultyproject WHERE IdFaculty={$idFaculty}";
		getQueryUpdate($query);
	}
}
?>